package com.programmingteam.wallpaperslideshow;

public class Config {

	public final static int MINUTE = 60000;

	public class Http {
		public static final int TIMEOUT_CONNECTION = 10000;
		public static final int TIMEOUT_READ_TEXT = 30000;
		public static final int TIMEOUT_READ_FILE = 60000;
		public static final int DOWNLOAD_BUFFER_SIZE = 10 * 1024; // bytes
	}

	public class ImageSearch {
		public static final int RESULTS_PER_PAGE = 100;
		public static final int MAX_SEARCH_LOOPS = 50;
	}

	public class ImageSize {
		public static final int THUMBNAIL_WIDTH = 400;
		public static final int THUMBNAIL_HEIGHT = 400;
		public static final int DOWNSAMPLE_TRESHOLD = 2000000; // 2MPix
	}

	public class Cache {
		public static final int NUM_THUMBNAILS = 53;
		public static final int NUM_IDS = 1000;
	}

	public class Service {
		public static final int NO_CONNECTION_TIMER_INTERVAL = 15; // in minutes
		public static final String BROADCAST_ACTION_ON_DOWNLOADED = "com.programmingteam.wallpaperslideshow.servcie.on_image_downloaded";
	}

	/** SharedPreferences keys */
	public class SharedKeys {
		public final static String INIT = "INIT";
		public final static String SEARCH_KEYWORDS = "SEARCH_KEYWORDS";
		public final static String EVENT_LOCATION_DISTANCE = "EVENT_LOCATION_DISTANCE";
		public final static String EVENT_TIMER_INTERVAL = "EVENT_TIMER_INTERVAL";
		public final static String EVENT_ON_LOCATION_CHANGE = "SET_WP_ON_LOCATION_CHANGE";
		public final static String EVENT_ON_TIMER_EVNET = "SET_WP_ON_TIMER_EVNET";
		public final static String NOTIFICATION_ENABLED = "NOTIFICATION_ENABLE";
		public final static String SERVICE_NAME = "SERVICE_NAME";
		public final static String SET_WALLPAPER_ON_EVENT = "CHANGEWALLPAPER_ENABLE";
		public final static String WIFI_ONLY = "WIFI_ONLY";
		public final static String IMAGEQUALITY = "IMAGEQUALITY";
		
		// Location type: LOCATION_TRACK_CURRENT or LOCATOIN_STATIC
		public final static String LOCATION_TYPE = "LOCATION_TYPE";
		
		// Static location parameters
		public final static String LOCATION_LATITUDE = "LOCATION_LATITUDE";
		public final static String LOCATION_LONGITUDE = "LOCATION_LONGITUDE";

		/** Previous search results */
		public final static String PSEARCH_LATITUDE = "PSEARCH_LATITUDE";
		public final static String PSEARCH_LONGITUDE = "PSEARCH_LONGITUDE";
		public final static String PSEARCH_KEYWORDS = "PSEARCH_KEYWORDS";
		public final static String PSEARCH_SERVICENAME = "PSEARCH_SERVICENAME";
		public final static String PSEARCH_ACCURACY = "PSEARCH_ACCURACY";
		public final static String PSEARCH_QUALITY = "PSEARCH_QUALITY";
		public final static String PSEARCH_PAGE = "PSEARCH_PAGE";
		public final static String PSEARCH_EXTENDED = "PSEARCH_EXTENDED";
	}

	/** SharedPreferences defaults */
	public class SharedDefaults {
		public final static String SEARCH_KEYWORDS = "landscape,building";
		public final static int EVENT_LOCATION_DISTANCE = 3;
		public final static int EVENT_TIMER_INTERVAL = 120 * MINUTE;
		public final static boolean EVENT_ON_LOCATION_CHANGE = true;
		public final static boolean EVENT_ON_TIMER_EVNET = true;
		public final static boolean NOTIFICATION_ENABLED = true;
		public final static boolean SET_WALLPAPER_ON_EVENT = true;
		public final static String SERVICE_NAME = Const.PROVIDER_NAME_PANORAMIO;
		public final static boolean WIFI_ONLY = false;
		public final static int IMAGEQUALITY = Const.QUALITY_HIGH;

		public final static int LOCATION_TYPE = Const.LOCATION_TRACK_CURRENT;
		public final static float LOCATION_LATITUDE = 48.859068f;
		public final static float LOCATION_LONGITUDE = 2.296486f;

		/** Previous search results */
		public final static float PSEARCH_LATITUDE = 0;
		public final static float PSEARCH_LONGITUDE = 0;
		public final static String PSEARCH_KEYWORDS = "";
		public final static String PSEARCH_SERVICENAME = Const.PROVIDER_NAME_PANORAMIO;
		public final static int PSEARCH_ACCURACY = 3;
		public final static int PSEARCH_QUALITY = Const.QUALITY_HIGH;
		public final static int PSEARCH_PAGE = 1;
		public final static int PSEARCH_EXTENDED = 0;
	}

	public class Const {
		public final static int QUALITY_HIGH = 0;
		public final static int QUALITY_MEDIUM = 1;
		public final static int QUALITY_LOW = 2;
		public final static String PROVIDER_NAME_PANORAMIO = "panoramio";
		public final static String PROVIDER_NAME_FLICKR = "flickr";

		public final static int LOCATION_TRACK_CURRENT = 1;
		public final static int LOCATOIN_STATIC = 2;
		
		/** Intent flags and data (as extra) */
		public final static String F_SCHEDULED = "F_SCHEDULED"; //boolean flag (true=scheduled call), default false
		public final static String F_LOCATION = "F_LOCATION";   //boolean flag (true=readlocation), default false
		public final static String F_PHOTODATA = "F_PHOTODATA"; //boolean flag (true=change to saved photo), default false
		public final static String F_NEXTPHOTO = "F_NEXTPHOTO"; //boolean flag (true=just set next photo), default true
		
		public final static String D_PHOTODATA_ID = "D_PHOTODATA_ID"; //long photoId
		
		public final static int NOTIFY_SERVICE_ID = 1;
	}
	
	public class UI {
		public final static int GALLERYVIEW_SIZE = 99;
		public final static int GALLERYVIEW_CACHE_SIZE = 20;
	}

}
